package day14_21.day17;

import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Scanner;

public class Main01 {
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int n = scn.nextInt();
        int[] array = array(n);
        int cur = 0;
        for (int i = 0; i < array.length; i++) {
            if (array[i] % 2 == 0){
                System.out.println(i + 1);
                cur += 1;
                break;
            }
        }
        if (cur == 0){
            System.out.println(0);
        }


    }
    public static int[] array(int n){
        if (n == 1){
            return new int[]{1};
        }else if (n == 2){
            return new int[]{1 ,1 ,1};
        }
        int[] array = new int[2 * n -1];
        for (int i = 0; i < array.length; i++) {
            if (i == 0 || i == array.length -1){
                array[i] = 1;
            }else if (i == 1 || i == array.length - 2){
                if (i == array[array.length - 2]){
                    array[i] = array[array.length - 1 - i];
                }else {
                    array[i] = array(n - 1)[0] + array(n - 1)[1];
                }
            }else {
                array[i] = array(n - 1)[i - 2] + array(n - 1)[i - 1] + array(n - 1)[i];
            }
        }
        return array;
    }
}
